<?php 
if (!empty($this->flash_messages))
{
    foreach ($this->flash_messages as $flash_message)
    {
        echo '<div class="message">'.$flash_message.'</div>';
    }
}
?>
<h1 class="caption"><?php echo Zend_Registry::get('locale')->_('Files') ?></h1>


<?php if (!empty($this->files)) : ?>
    <?php foreach ($this->files as $file) : ?>
      <div class="file-item">
        <em><a href="<?php echo $this->siteUrl().'/'.Application_Model_File::UPLOAD_DIR.'/'.$file ?>" target="_blank" title="<?php echo $file ?>"><?php echo $file ?></a></em>
        <?php if (Zend_Registry::get('user')->canManage()) : ?>
        <div class="file-links">
            <a class="delete" href="javascript:if(confirm('<?php echo Zend_Registry::get('locale')->_('Are you sure ?')?>')){window.location.href='<?php echo $this->fixUrl('file/delete/'.$file) ?>'}"><?php echo Zend_Registry::get('locale')->_('Delete') ?></a>
        </div>
        <?php endif; ?>
        <div class="clear"></div>
      </div>
    <?php endforeach; ?>
<?php endif; ?>

<?php echo $this->paginator ?>